#
# -= Makefile for application =-
#
# Note:
# . "make config" must be done for initial routines.
#
# Usage:
# . Change the ROOT definition, if necessary;
#   Make it point to the root of the software tree.
#

# Destination to the root of software tree
ROOT = ../../../../../..

# output file name
OUT = bloader3

all :
	${MAKE} release
	${MAKE} -f Makefile.cmd all

config : sys_config.h compiler.def
	cp sys_config.h ${ROOT}/inc
	cp compiler.def ${ROOT}/src

clean :
	${MAKE} -f Makefile.cmd clean

new :
	${MAKE} -f Makefile.cmd new

release :
	${MAKE} -f Makefile.cmd release

# Link file
link :
	${LD} ${LDFLAGS} ${NEED} -o ${OUT}.out -Map ${OUT}.map \
	  -T lscript.ld libslot.a  -lbl libboot.a -lbl ${LIB} libstandby.a lib7zip.a liblog.a -lc -lgcc -le
	${OBJCOPY} -O binary ${OUT}.out ${OUT}.abs
	./bmerger.exe ${OUT}.abs boot.cfg 128 384
#	${OBJDUMP} -D ${OUT}.out > ${OUT}.dis
	cp ${OUT}.abs ../prj/app/demo/combo/sabbat_dual/${OUT}.abs

cleanld :
	rm -f ${OUT}.out ${OUT}.map ${OUT}.dis libbl.a

sdk:
	cd ${ROOT}/src/boot; \
	${MAKE} rebuild_36

sdk_rel:
	${MAKE} -f Makefile.cmd sdk_rel

sdk_clean :
	${MAKE} -f Makefile.cmd sdk_clean

